package io.gitee.mingbaobaba.apijson.querycondition.query.conditions;

import org.springframework.util.CollectionUtils;

/**
 * <p>排序片段</p>
 */
class OrderSegment implements DslSegment {

    @Override
    public void apply(AbstractBaseWrapper<?, ?, ?> wrapper) {
        if (CollectionUtils.isEmpty(wrapper.orderByList)) {
            return;
        }
        wrapper.apiJsonParams.put(EnumApiJson.ORDER.getCode(), SegmentJoiner.join(",", wrapper.orderByList));
    }
}

